package demo.com.xml;

import java.io.InputStream;

import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

/**
 * Created by se1 on 16-11-17.
 */
public class SAXXmlParser {

    public void parse(InputStream is) {
        SAXParserFactory factory = SAXParserFactory.newInstance();
        try {
            SAXParser parser = factory.newSAXParser();
            SAXParserHandler handle = new SAXParserHandler();
            parser.parse(is, handle);
            is.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
